<template>
<ul class="nav navbar-right top-nav">
  <!-- <navTreeItem :navItemsData='mailList'></navTreeItem> -->
  <navTreeItem :navItemsData='userList'></navTreeItem>
</ul>
</template>

<script type="text/javascript">
  import navTreeItem from './navTreeItem'

  export default {
    data() {
       return {
           userList: userList,
           mailList:mailList
       }
    },
    props:['user-name'],
    watch:{
      userName(val){
        this.userList.navTitle = this.userName;
      }
    },
    mounted:function(){
      this.userList.navTitle = this.userName;
    },
    components:{navTreeItem}
  }



  var userList = {
    navIcon:"",
    navTitle:'',
    navUser:true,
    isHook:true,
    navList:[
      // {
      //   icon:"glyphicon-user",
      //   title:"个人中心",
      //   unique:"center"
      // },
      // {
      //   icon:"glyphicon-lock",
      //   title:"修改密码",
      //   unique:"password"
      // },
      {
        icon:"glyphicon-off",
        title:"退出",
        unique:"exit"
      }
    ]
  };
  var mailList = {
    navIcon:"glyphicon-envelope",
    navTitle:"",
    navMail:true,
    isHook:false,
    navList:[
      {
        addresser:"John",
        time:"2017-03-27 14:14:14",
        content:"昨天你把东西丢在我这边了,过来拿一下吧"
      },
      {
        addresser:"Peter",
        time:"2017-03-28 14:14:14",
        content:"明天去打球吗"
      }
    ]
  };


</script>
